import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import { resolve } from "path";

const Host = "https://portal-newdev.center.org.cn";

export default defineConfig({
  base: "./",
  build: {
    outDir: "dist",
  },
  plugins: [uni()],
  resolve: {
    alias: {
      "@": resolve(__dirname, "src"),
    },
  },
  server: {
    proxy: {
      "/front-api": {
        target: Host,
        changeOrigin: true,
      },
      "/order-api": {
        target: Host,
        changeOrigin: true,
      },
      "/setting-api": {
        target: Host,
        changeOrigin: true,
      },
      "/auth": {
        target: Host,
        changeOrigin: true,
      },
    },
  },
});
